package com.tyk.bookstore.back.system.valid.annotation;

import com.tyk.bookstore.back.system.valid.validator.AccountConstraintValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author tyk
 * @description 校验用户账号（不校验NULL值）
 */
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = AccountConstraintValidator.class)
public @interface AccountValid {

	String message() default "用户账号不合法";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

}
